unit ToolbarFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, ImgList, ComCtrls, ToolWin, UnitMapFrame, UnitXFPublic;

type
  TFormToolbar = class(TForm)
    Panel1: TPanel;
    ToolBar1: TToolBar;
    btnMapInfo: TToolButton;
    btnGoogleMap: TToolButton;
    ilBackup: TImageList;
    btnHyBird: TToolButton;
    ToolButton4: TToolButton;
    ToolButton5: TToolButton;
    procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure btnMapInfoClick(Sender: TObject);
  private
    { Private declarations }
    FMapType: TMapType;
  public
    { Public declarations }
  end;

var
  FormToolbar: TFormToolbar;
 // FMapType: TM
implementation

{$R *.dfm}


procedure TFormToolbar.Panel1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(self.Handle, WM_SYSCOMMAND,SC_MOVE+HTCAPTION, 0);
end;


procedure TFormToolbar.btnMapInfoClick(Sender: TObject);
begin
  case TToolButton(Sender).Tag of
    0: FMapType := mtMapInfo;
    1: FMapType := mtGoogle;
  end;

  btnMapInfo.Down := FMapType = mtMapInfo;
  btnGoogleMap.Down := FMapType = mtGoogle;

  SendMessage(Application.MainForm.Handle, WM_SET_MAPTYPE, TToolButton(Sender).Tag, 0);
end;

end.
